<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<!-- import CSS -->
		<link rel="stylesheet" href="elementui-lib/lib/index.css">
		<link rel="stylesheet" href="css/common.css">
		<title>登录</title>
	</head>
	<body>
		<div id="app" v-cloak>
			<div class="logincont vertical">
				<div class="title">保险后台管理系统</div>
				<el-form ref="form" :model="form" label-width="80px">
					<el-form-item label="账号:">
						<el-input v-model="form.name" style="width:260px;"></el-input>
					</el-form-item>
					<el-form-item label="密码:">
						<el-input type="password" v-model="form.password" style="width:260px;"></el-input>
					</el-form-item>
					<div class="text-c">
					<el-button type="primary" @click="onSubmit">登录</el-button>
					</div>
				</el-form>
			</div>
		</div>
	</body>

	<script src="elementui-lib/lib/vue.js"></script>
	<script src="elementui-lib/lib/index.js"></script>
	<script src="js/jquery-1.9.1.min.js"></script>
	<script src="js/axios.js"></script>
	<script src="js/data.js"></script>
	<script>
		var app = new Vue({
			el: "#app",
			mixins: [mix],
			data: function() {
				return {
					form: {
						name: "",
						password: ""
					}
				}
			},
			methods: {
				onSubmit() {
					if(this.form.name == "" || this.form.password==""){
						this.$message.warning('请输入账号和密码')
						return;
					}
					console.log(this.form);
					login().then(res => {
						if (res.data.code == 0) {
							
							localStorage.setItem('token',res.data.token)
						}
					})
					// window.location.href='1-advertising.html'
				}
			},
			created() {},
		});
	</script>
</html>
